package com.we.flink.userlabelplatform.table;

import java.math.BigDecimal;

public class TableUserLevel {
    public static final String KFKTABLE = "fdm.hhl01_user_level";
    public static final String QUERYSQL =
            "select uid, level, "
                    + "if(updated_at is null, 0, updated_at) as updated_at, "
                    + "if(account_status is null, -1, account_status) as account_status, "
                    + "if(loan_amount is null, -1, loan_amount) as loan_amount, "
                    + "if(loan_actual_amount is null, -1, loan_actual_amount) as loan_actual_amount, "
                    + "periods_money_scope "
                    + " from "
                    + KFKTABLE
                    + " where deleted_at is null and periods_money_scope is not null";

    public long uid;
    public String level;
    /** default null column */
    //    public byte account_status; //null默认空 0异常1初始状态2正常3逾期4失效5禁用6坏账
    public int account_status;

    public BigDecimal loan_amount; // 好借总额度
    public BigDecimal loan_actual_amount; // 好借实际额度
    public int updated_at; // 通过updated time 取最新的状态
    public String periods_money_scope;

    public TableUserLevel() {}

    public TableUserLevel(
            long uid,
            String level,
            int account_status,
            BigDecimal loan_amount,
            BigDecimal loan_actual_amount,
            int updated_at,
            String periods_money_scope) {
        this.uid = uid;
        this.level = level;
        this.account_status = account_status;
        this.loan_amount = loan_amount;
        this.loan_actual_amount = loan_actual_amount;
        this.updated_at = updated_at;
        this.periods_money_scope = periods_money_scope;
    }

    @Override
    public String toString() {
        return "TableUserLevel{"
                + "uid="
                + uid
                + ", level='"
                + level
                + '\''
                + ", account_status="
                + account_status
                + ", loan_amount="
                + loan_amount
                + ", loan_actual_amount="
                + loan_actual_amount
                + ", updated_at="
                + updated_at
                + ", periods_money_scope='"
                + periods_money_scope
                + '\''
                + '}';
    }

    public int getUpdated_at() {
        return updated_at;
    }

    public long getUid() {
        return uid;
    }

    public String getLevel() {
        return level;
    }

    public int getAccount_status() {
        return account_status;
    }

    public BigDecimal getLoan_amount() {
        return loan_amount;
    }

    public BigDecimal getLoan_actual_amount() {
        return loan_actual_amount;
    }

    public String getPeriods_money_scope() {
        return periods_money_scope;
    }
}
